home *** CD-ROM | disk | FTP | other *** search
/ AmigActive 10 / AACD 10.iso / AACD / Information / WebSites / Wirenet / files / Dashboard2.lha / Dashboard2 / AmiTCP / bin / StartNet < prev    next >
Text File  |  1998-03-27  |  2KB  |  59 lines

  1. /*
  2. $VER: StartNet 2.0 (26.3.98)
  3. (c) Neil Bothwick
  4.  
  5. Starts up AmiTCP or Miami and sets up everything
  6. ready to connect to the Internet
  7. */
  8.  
  9. options results
  10. address command
  11.  
  12. /* Load arexx libraries */
  13. 'Wirenet:bin/AddLibs'
  14.  
  15. /* Load prefs if not already done */
  16. if getclip('TCPstack') = '' then 'Wirenet:bin/WirenetPrefs LOAD'
  17.  
  18. /* Check if TCP stack is already running */
  19. if show(P,'AMITCP') | show(P,'MIAMI.1') then exit
  20.  
  21.     /* Mount TCP: first, so it can be used with Miami too */
  22.     'Assign TCP: Exists > NIL:'
  23.     if RC > 0 then 'Mount TCP: from AmiTCP:devs/Inet-Mountlist'
  24.  
  25. if pos(upper(getclip('TCPstack')),'1TRUEYES') > 0 then do
  26.     /* Start Miami */
  27.     'Run >NIL: Miami:Miami'
  28.     'Wait 3'
  29.     'WaitForPort MIAMI.1'
  30.     end
  31.  
  32. else do
  33.     'Assign APIPE: Exists > NIL:'
  34.     if RC > 0 then 'Mount APIPE: from AmiTCP:devs/APipe-Mountlist'
  35.  
  36.     /* login */
  37.     'AmiTCP:bin/login' getclip('UserName')
  38.     'AmiTCP:bin/umask 022'
  39.     /* start AmiTCP */
  40.     'AmiTCP:AmiTCP'
  41.     'WaitForPort AMITCP'
  42.     /* Configure loop-back device */
  43.     'AmiTCP:bin/ifconfig lo0 localhost'
  44.  
  45.     if getclip('IPAddress') ~= '0.0.0.0' then do
  46.         /* Add IP address entry for this host */
  47.         address 'AMITCP' 'ADD HOST' getclip('IPAddress') getclip('HostName')||getclip('DomainName')
  48.         /* Add route to this host */
  49.         'AmiTCP:bin/route add' getclip('IPAddress') 'localhost'
  50.         end
  51.  
  52.     /* Start the internet `super server' */
  53.     'run >NIL: AmiTCP:bin/inetd'
  54.     end
  55.  
  56. 'SetEnv NetState Offline'
  57. if exists('Wirenet:UserScripts/Startnet') > 0 then 'Wirenet:UserScripts/Startnet'
  58.  
  59.